﻿<prism:FlyoutView x:Class="Sumc.Client.ModernUI.Views.ScheduleRightTimeFlyout"
                  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  xmlns:local="using:Sumc.Client.ModernUI.Views"
                  xmlns:prism="using:Microsoft.Practices.Prism.StoreApps"
                  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                  mc:Ignorable="d"
                  prism:ViewModelLocator.AutoWireViewModel="true">
    <prism:FlyoutView.Resources>
        <DataTemplate x:Key="TimeTemplate">
            <TextBlock Text="{Binding}"
                       FontSize="36"
                       Foreground="{StaticResource DefaultDarkBrush}"
                       Margin="0,10,0,0"/>
        </DataTemplate>
    </prism:FlyoutView.Resources>
    <Grid VerticalAlignment="Stretch"
          Background="#d1d1d1">

        <!-- Root grid definition -->
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <!-- Header area for panel -->
        <Grid Grid.Row="0"
              Background="{StaticResource DefaultItemBackground}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <Button Command="{Binding GoBackCommand}"
                        x:Uid="PrivacyPolicyFlyoutBackButton"
                        Margin="30,40,0,0"
                        VerticalAlignment="Center"
                        Style="{StaticResource SnappedBackButtonStyle}"/>
            <Grid Grid.Column="1">
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>

                <TextBlock Grid.Row="0"
                           Margin="10,40,0,0"
                           FontFamily="Segoe UI"
                           FontWeight="SemiLight"
                           FontSize="24"
                           TextWrapping="Wrap"
                           VerticalAlignment="Top"
                           x:Uid="ScheduleRightTimeFlyoutTextBlockRightInformation" />
                <TextBlock Grid.Row="1"
                           Margin="10,10,0,0"
                           TextAlignment="Left"
                           Text="{Binding Information}"
                           Visibility="{Binding Information, Converter={StaticResource NullToVisibilityConverter}}"
                           Foreground="{StaticResource DefaultDarkBrush}"
                           FontSize="12"/>
            </Grid>
        </Grid>

        <Grid Grid.Row="1"
              Margin="50, 0, 50, 20">
            <Grid.RowDefinitions>
                <RowDefinition Height="30" />
                <RowDefinition Height="auto" />
                <RowDefinition Height="auto" />
                <RowDefinition Height="auto" />
                <RowDefinition Height="auto" />
            </Grid.RowDefinitions>
            <ProgressBar IsIndeterminate="{Binding LoadingData}"
                         Width="250" 
                         Height="30"
                         Visibility="{Binding LoadingData, Converter={StaticResource BooleanToVisibilityConverter}}"
                         Style="{StaticResource ProgressBar}" />

            <TextBlock Grid.Row="1"
                       Foreground="{StaticResource DefaultDarkBrush}"
                       HorizontalAlignment="Left"
                       FontSize="12"
                       TextTrimming="WordEllipsis"
                       Visibility="{Binding Route, Converter={StaticResource NullToVisibilityConverter}}"
                       Margin="0,20,0,0">
                <Run x:Uid="ScheduleRightTimeFlyoutRunRoute" />
                <Run Text="{Binding Route}" />
            </TextBlock>

            <TextBlock Margin="0,10,0,0"
                       HorizontalAlignment="Left"
                       FontSize="12"
                       TextTrimming="WordEllipsis"
                       Foreground="{StaticResource DefaultDarkBrush}"
                       Visibility="{Binding Stop, Converter={StaticResource NullToVisibilityConverter}}"
                       Grid.Row="2">
                <Run x:Uid="ScheduleRightTimeFlyoutRunStop" />
                <Run Text="{Binding Stop.Name}" />
                <Run Text=" (" />
                <Run Text="{Binding Stop.Number}" />
                <Run Text=")" />
            </TextBlock>

            <TextBlock Grid.Row="3"
                       HorizontalAlignment="Left"
                       FontSize="12"
                       Margin="0,30,0,0"
                       Foreground="{StaticResource DefaultDarkBrush}"
                       Visibility="{Binding RightArrivalTimes, Converter={StaticResource NullToVisibilityConverter}}"
                       x:Uid="ScheduleRightTimeFlyoutTextBlockRightTime" />
            <ItemsControl Grid.Row="4"
                       ItemsSource="{Binding RightArrivalTimes}"
                       ItemTemplate="{StaticResource TimeTemplate}"/>
        </Grid>
    </Grid>
</prism:FlyoutView>
